<template>
  <div>
    <h1>Home</h1>
    <router-link to="/home/music">
      <button>Music</button>
    </router-link>
    <router-link
      :to="{
        name: 'News',
      }"
      ><button>News</button></router-link
    >
    <!-- 在v4版本中keep-alive（缓存组件）的使用 -->
    <router-view  v-slot="{Component}">
      <keep-alive>  
        <component :is="Component"></component>
      </keep-alive>
    </router-view>
  </div>
</template>

<script lang="ts">
 import { defineComponent } from 'vue'
  export default  defineComponent({
    name:'Home'
  })
</script>
<script lang="ts" setup>
  
</script>

<style lang="scss" scoped>
  
</style>